package com.wxtl.action;

import java.util.ArrayList;
import java.util.List;

import com.wxtl.action.base.BaseAction;
import com.wxtl.entity.GCity;
import com.wxtl.entity.GProvince;
import com.wxtl.service.CityService;
import com.wxtl.service.ProvinceService;

/**
 * 通用的action
 * @author liulin
 * @version 2012-12-29
 */
public class CommonAction extends BaseAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7822557905151900196L;
	
	private ProvinceService provinceService;
	private CityService cityService;
	private String provinceId;
	
	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}

	private List<GProvince> proList = new ArrayList<GProvince>();
	private List<GCity> cityList = new ArrayList<GCity>();
	
	public List<GProvince> getProList() {
		return proList;
	}

	public void setProList(List<GProvince> proList) {
		this.proList = proList;
	}

	public List<GCity> getCityList() {
		return cityList;
	}

	public void setCityList(List<GCity> cityList) {
		this.cityList = cityList;
	}
	
	public ProvinceService getProvinceService() {
		return provinceService;
	}

	public void setProvinceService(ProvinceService provinceService) {
		this.provinceService = provinceService;
	}

	public CityService getCityService() {
		return cityService;
	}

	public void setCityService(CityService cityService) {
		this.cityService = cityService;
	}

	public String queryAllProvince(){
		setProList(provinceService.getAllProvince());
		return SUCCESS;
	}
	
	public String queryAllCity(){
		setCityList(cityService.queryCityByProvince(Integer.parseInt(provinceId)));
		return SUCCESS;
	}
}
